<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
		<script type="text/javascript" src="js/jquery-1.2.6.js"></script>
		<link type="text/css" rel="stylesheet" href="style/style.css" />
        <script type="text/javascript" src="plugin/artDialog.js?skin=green"></script>
        <script type="text/javascript">
            document.write('<script type="text/javascript" src="js/'+getQueryStr("language")+'.js"><\/script>');
        </script>
        <title></title>
</head>
<body class="gui">

<div id="wrapper">
<div id="content">
	<div id="header">
<div id="logo">
<h1>Control Panel</h1>
</div>
</div>
<div id="main">
<div id="contents">
<form name="filters"  method="post" >
<fieldset>
<legend>
    <label sid="guide.title3"></label>
   </legend>
<div class="frame_tab_layer">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
<!--<tr>
<td  colspan="2" class="frame_tab_right" style="padding-right:50px;" style="padding-right:50px;">
	<script type="text/javascript">Capture(guide.note9)</script>
</td>
</tr>-->
<tr>
              <td align="left" width="33%" style="padding-left:50px;" ><label for="id2292">
                  <label sid="wireless_basic.wifi_button"></label>

              </label>
              </td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2292" id="id2292" value="on" checked>&#160;
                  <label sid="wireless.on"></label>

              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2292" id="id2292" value="off">&#160;
                  <label sid="wireless.off"></label>

              </td>
            </tr>
            <tr>
              <td align="left" width="33%" style="padding-left:50px;" ><label for="id2165">
                  <label sid="wireless_basic.network_mode"></label>
                  </label>
              </td>
              <td class="frame_tab_right">
              	<select name="id2165" id="id2165">
        					<option value=0>802.11b+g</option>
        					<option value=1>802.11b</option>
        					<option value=4>802.11g</option>
        					<option value=9>802.11b+g+n</option>
							<option value=6>802.11n</option>
      			</select>
             </td>
            </tr>
             <tr>
              <td align="left" width="33%" style="padding-left:50px;" ><label for="id2164">
                  <label sid="wireless_basic.ssid"></label>
                  </label>
              </td>
              <td class="frame_tab_right">
              	<input type="text" name="id2164" id="id2164" size="30" maxlength="30"/>
              </td>
            </tr>
            <tr>
              <td align="left" width="33%" style="padding-left:50px;" ><label for="id2198">
                  <label sid="wireless_basic.broadcast_ssid"></label>
                  </label>
              </td>
              <td class="frame_tab_right">
              	<input type="radio" name="id2198" id="id2198" value="0" checked >&#160;
                  <label sid="main.enable"></label>

              	<span style="padding-left:20px;"></span>
              	<input type="radio" name="id2198" id="id2198" value="1">&#160;
                  <label sid="main.disable"></label>

              </td>
            </tr>
            <!--<tr>
              <td align="left" width="33%" style="padding-left:50px;" ><label for="bssid"><script type="text/javascript">Capture(wireless_basic.bssid)</script></label>
              </td>
              <td class="frame_tab_right" id="bssid"></td>
            </tr>-->
            <tr id="div_11a_channel" name="div_11a_channel">
              <td align="left" width="33%" style="padding-left:50px;" ><label for="id2167">
                  <label sid="wireless_basic.frequency"></label>
                </label>
              </td>
              <td class="frame_tab_right">
              	<select id="id2167" name="id2167">
						<option value=0 id="basicFreqAAuto" sid="wireless_basic.ht_guard_interval_select1"></option>
						<option value=1 >2412MHz (1)</option>
						<option value=2 >2417MHz (2)</option>
						<option value=3 >2422MHz (3)</option>
						<option value=4 >2427MHz (4)</option>
						<option value=5 >2432MHz (5)</option>
						<option value=6 >2437MHz (6)</option>
						<option value=7 >2442MHz (7)</option>
						<option value=8 >2447MHz (8)</option>
						<option value=9 >2452MHz (9)</option>
						<option value=10 >2457MHz (10)</option>
						<option value=11 >2462MHz (11)</option>
						<option value=12 >2467MHz (12)</option>
						<option value=13 >2472MHz (13)</option>
						<option value=14 >2477MHz (14)</option>
				</select>
              </td>
            </tr>
            </table>
</div>
</fieldset>

 <fieldset>
<legend>
    <label sid="guide.note16"></label>
   </legend>
<div class="frame_tab_layer">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cmenutitle">
<!--<tr>
<td  colspan="2"  class="frame_tab_right" style="padding-right:50px;">
	<script type="text/javascript">Capture(guide.note17)</script>
</td>
</tr>-->
 <tr>
<td  colspan="2"  class="frame_tab_right" style="padding-right:50px;">
	<input type="radio" name="wireless_mode" id="mode1" value="0" onclick='$("#tr2231").hide();' />
    <label sid="guide.note18"></label>
</td>
</tr>
<tr>
<td  colspan="2"  class="frame_tab_right" style="padding-right:50px;">
	<input type="radio" name="wireless_mode" id="mode2" value="1" onclick='$("#tr2231").show();' checked />
    <label sid="guide.note19"></label>
</td>
</tr> 
<tr id="tr2231">
<td  colspan="2"  class="frame_tab_right" style="padding-right:50px;">
	<span style="padding-left:20px;"></span>
    <label sid="guide.note20"></label>
	<span style="padding-left:10px;"></span><input name="id2231" id="id2231" size="28" maxlength="64" value="">
</td>
</tr>
</table>
</div>
</fieldset>
<br/>
<div class="submitFooter">

        <input class="button" type="button"  sid="guide.previous" name="previous" value="" />
        <input class="button" type="button"  sid="guide.next" name="submit" value="" />
        <input class="button" type="button"  sid="main.cancel" name="cancel" value="" />

</div>
</form>
</div>
</div>
<br/>
<div id="helpContainer">
<div id="help">
<div><h2><img src="images/help_title.png" border="0"/>
    <label sid="share.help"></label>
   </h2></div>
<div id="helpBody">
    <dl>
<dt class="term"><label sid="wireless_basic.ssid"></label></dt>
<dd class="definition"><label sid="wireless_basic.ssid_note"></label></dd>
<dt class="term"><label sid="wireless_basic.broadcast_ssid"></label></dt>
<dd class="definition"><label sid="wireless_basic.broadcast_ssid_note"></label></dd>
<dt class="term"><label sid="wireless_basic.frequency"></label></dt>
<dd class="definition"><label sid="wireless_basic.frequency_note"></label></dd>
</dl>
</div>
</div>
</div>
<div id="floatKiller"></div>
<div id="statusInfo">

<div class="info"><span id="loginuser"></span></div>
    <div class="info">
        <button class="logout" onclick="reboot();">
            <img src="images/reboot.gif" border="0">&#160;
            <label sid="tools.td10"></label>
        </button>
        <button class="logout" onclick="logout();">
            <img src="images/logout.gif" border="0">&#160;
            <label sid="share.logout"></label>
        </button></div>
</div>

</div>
</div>
<div id="lock_div">&nbsp; </div>
<div id="lock_div2">&nbsp;</div>
<div id="message_panel"><span id="mess">&nbsp;</span><br/>
  <br/>
  <img src="images/jd.gif"/>
</div>
<div id="rightMenu" style="display: none">
    <ul>
        <li id="editWords">Edit</li>
        <li id="defaultValue">Default</li>
    </ul>
</div>

<script type="text/javascript">
    setTimeout("height_div()",500);
</script>
<script type="text/javascript" src="lib.js"></script>
<script type="text/javascript" src="js/message_panel.js"></script>
<script type="text/javascript">
    $("label").each(function () {
        var currentVal =$(this);
        var values =eval($(this).attr("sid"));
        if(typeof(values)!=="undefined"){

            $(this).html(decodeURIComponent(values));

        $(this).rightClick(function(){
            if(currentVal.attr("sid")) {
                showEditDialog(currentVal);
                currentVal.addClass("EditPosition");
            }
        });
        }
        if($(this).html()=="" && $(this).parent().hasClass("definition")){
            $(this).parent().hide();
            $(this).parent().prev().hide();
        }
    });

    $("input[type='button']").each(function () {
        $(this).val(decodeURIComponent(eval($(this).attr("sid"))));
        var currentButton =$(this);
        $(this).rightClick(function(){
            showEditDialog(currentButton,'val');
            currentButton.addClass("EditPosition");
        })


    });

    $("button").each(function(){
        var currentButton =$(this);
        var ButtonVal = currentButton.find("label");
        $(this).rightClick(function(){
            if(ButtonVal.attr("sid")) {
                showEditDialog(ButtonVal);
                ButtonVal.addClass("EditPosition");
            }
        })
    });
    $("option").each(function(){
        var optionValue =eval($(this).attr("sid"));
        if(typeof(optionValue)!=="undefined"){
        $(this).text(decodeURIComponent(optionValue));
        }
    });
    $("select").each(function(){
        var obj2 =$(this);
        $(this).rightClick(function(){
            var selectVal = obj2.find("option:selected");
            showEditDialog(selectVal);
            selectVal.addClass("EditPosition");
        })

    });
	var thisurl = document.URL;
	var oldsettext = thisurl.split("?")[1];
	oldsettext = oldsettext.substr(8,oldsettext.length);
	var types="";
	if(oldsettext.indexOf("home")>=0){
		types="home";
		}else{
			types="company";
			}
  var nonames = new Array("submit","previous","cancel","wireless_mode","id2167");
	var sendtext = getSendText(nonames);
	sendtext += "&id=2287&id=2290&id=2162&id=2288&id=2289";
	DataRequest("get_json",sendtext,function(data){
  	getResult(nonames,data);
  });

	$("[name=submit]").click(function () {
        var nonames = new Array("submit","previous","cancel","wireless_mode","id2167");
		if(CheckValue()){
		$(".errormsg").html('');
		var settext = getSetText(nonames);
		if($("#mode1").attr("checked")){
			settext+="&id2226=OPEN";
			settext+="&id2227=NONE";
			}else{
			  settext+="&id2226=WPAPSKWPA2PSK&id2227=AES";
			}
		var id2165 = $("#id2165").val();
		var rate = $("#abg_rate").val();
        var id2167 = $("#id2167").val();
		if (id2165=="0" || id2165=="2"  || id2165=="4" ) {
			if (rate == 1 || rate == 2 || rate == 5 || rate == 11)
				settext+="&id2290=CCK";
			else
				settext+="&id2290=OFDM";

			if (rate == 1)
				settext+="&id2255=0";
			else if (rate == 2)
				settext+="&id2255=1";
			else if (rate == 5)
				settext+="&id2255=2";
			else if (rate == 6)
				settext+="&id2255=0";
			else if (rate == 9)
				settext+="&id2255=1";
			else if (rate == 11)
				settext+="&id2255=3";
			else if (rate == 12)
				settext+="&id2255=2";
			else if (rate == 18)
				settext+="&id2255=3";
			else if (rate == 24)
				settext+="&id2255=4";
			else if (rate == 36)
				settext+="&id2255=5";
			else if (rate == 48)
				settext+="&id2255=6";
			else if (rate == 54)
				settext+="&id2255=7";
			else
				settext+="&id2255=33";
		}
		else if (id2165== "1") {
			settext+="&id2290=CCK";
			if (rate == 1)
				settext+="&id2255=0";
			else if (rate == 2)
				settext+="&id2255=1";
			else if (rate == 5)
				settext+="&id2255=2";
			else if (rate == 11)
				settext+="&id2255=3";
		}
            if(id2167==0){
                settext+="&id2200=1&id2167="+id2167;
            }else{
                settext+="&id2200=0&id2167="+id2167;
            }
		settext += oldsettext;
		settext=settext.replace(/\#/g,"%23");
		if(types=="home"){
			window.location.href="guideCaller.htm?settext="+settext+"&language="+getQueryStr("language");
			}else{
		   window.location.href="guideCaller.htm?settext="+settext+"&language="+getQueryStr("language");
	}
	}
	});

	function CheckValue()
{
	if ($("#id2164").val == "")
	{
		alert("Please enter SSID!");
		$("#id2164").focus();
		$("#id2164").select();
		return false;
	}

	if($("#mode1").attr("checked")){
		//nothing
	}else{
		var keyvalue = $("#id2231").val();
		if (keyvalue.length == 0){
			alert(secure.msg1);
			return false;
		}

		if (keyvalue.length < 8){
			alert(secure.msg2);
			return false;
		}

		if (keyvalue.length == 64 && checkHex(keyvalue) == false) {
			alert(secure.msg3);
			return false;
		}

		if(checkInjection($("#id2231").val()) == false){
			alert(secure.msg4);
			return false;
		}

	}
	return true;
}

function checkHex(str){
	var len = str.length;

	for (var i=0; i<str.length; i++) {
		if ((str.charAt(i) >= '0' && str.charAt(i) <= '9') ||
			(str.charAt(i) >= 'a' && str.charAt(i) <= 'f') ||
			(str.charAt(i) >= 'A' && str.charAt(i) <= 'F') ){
				continue;
		}else
	        return false;
	}
    return true;
}

function checkInjection(str)
{
	var len = str.length;
	for (var i=0; i<str.length; i++) {
		if ( str.charAt(i) == '\r' || str.charAt(i) == '\n'){
				return false;
		}else
	        continue;
	}
    return true;
}


     $("[name=previous]").click(function () {
        history.back();
    });

    $("[name=cancel]").click(function () {
        window.location.href="menuGuide.htm?language="+getQueryStr("language");
    });
</script>
</body>
</html>
